import { Component } from '@angular/core';
import {  NavController, NavParams } from 'ionic-angular';
import { Api } from '../../providers/api-service';

/**
 * 
 * 战团详情
 * @export
 * @class GroupDetailPage
 */
@Component({
  selector: 'page-group-detail',
  templateUrl: 'group-detail.html',
})
export class GroupDetailPage {

  groupId: string;
  zhanduanDetails: any;
  menuSelectIndex = 0;

  constructor(public navCtrl: NavController, 
              public navParams: NavParams,
              public api: Api,) {

  }

  ionViewDidLoad() {
    let parets = this.navParams.get("params");
    this.groupId = parets.ID;
    this.loadData();
  }

  loadData() {
    this.api.postBody("V1/GetGroupAllInfo", { 
      "GroupID": this.groupId
    }).then(data => {
      console.log(data);
      this.zhanduanDetails = data.Data;
    }).catch(err => {
      console.log(err)
    })
  }

  // action
  clickMenu(index) {
    console.log(index);
    this.menuSelectIndex = index;
  }

}
